package edu.cibertec.alquiler.action;

import java.util.List;
import java.util.Map;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

import edu.cibertec.alquiler.entity.Categoria;
import edu.cibertec.alquiler.entity.Estado;
import edu.cibertec.alquiler.entity.Genero;
import edu.cibertec.alquiler.entity.Perfil;
import edu.cibertec.alquiler.service.ApplicationBusinessDelegate;
import edu.cibertec.alquiler.service.CombosService;

public class ListadoCombos extends ActionSupport{

	private static final long serialVersionUID = 1L;

	private static ApplicationBusinessDelegate abd = new ApplicationBusinessDelegate();
	private CombosService comService= abd.getCombosService();
	
	private List<Categoria> lstCategoriaCombo;
	private List<Genero> lstGeneroCombo;
	private List<Estado> lstEstadoCombo;
	private List<Perfil> lstPerfilCombo;
	
	public String listarCategoriaCombo(){
		try {
			Map<String, Object> session= ActionContext.getContext().getSession();
			session.put("listarCategoriaCombo", comService.listarCategoriaCombo());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return SUCCESS;
	}
	
	public String listarGeneroCombo(){
		try {
			Map<String, Object> session=ActionContext.getContext().getSession();
			session.put("listarGeneroCombo", comService.listarGeneroCombo());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return SUCCESS;
	}
	
	public String listarEstadoCombo(){
		try {
			Map<String, Object> session=ActionContext.getContext().getSession();
			session.put("listarEstadoCombo", comService.listarEstadoCombo());
		} catch (Exception e) {
			e.printStackTrace();
		} 
		return SUCCESS;
	}
	
	public String listarPerfilCombo(){
		try {
			Map<String, Object> session=ActionContext.getContext().getSession();
			session.put("listarPerfilCombo", comService.listarPerfilCombo());
		} catch (Exception e) {
			e.printStackTrace();
		}
		return SUCCESS;
	}
	
	public List<Perfil> getLstPerfilCombo() {
		return lstPerfilCombo;
	}

	public void setLstPerfilCombo(List<Perfil> lstPerfilCombo) {
		this.lstPerfilCombo = lstPerfilCombo;
	}

	public List<Categoria> getLstCategoriaCombo() {
		return lstCategoriaCombo;
	}
	public void setLstCategoriaCombo(List<Categoria> lstCategoriaCombo) {
		this.lstCategoriaCombo = lstCategoriaCombo;
	}
	public List<Genero> getLstGeneroCombo() {
		return lstGeneroCombo;
	}
	public void setLstGeneroCombo(List<Genero> lstGeneroCombo) {
		this.lstGeneroCombo = lstGeneroCombo;
	}
	public List<Estado> getLstEstadoCombo() {
		return lstEstadoCombo;
	}
	public void setLstEstadoCombo(List<Estado> lstEstadoCombo) {
		this.lstEstadoCombo = lstEstadoCombo;
	}

	
}
